Skip to main content

Media Gateway

How to obtain a public URL for NFL All Day media.

The endpoint can be accessed at:

https://media.nflallday.com/editions/${editionFlowId}/media/${mediaType}

editionFlowId

editionFlowId is the flowId for the edition you are trying to access. The following cadence script can be used to obtain a moments editionFlowId:

import NonFungibleToken from 0xNONFUNGIBLETOKENADDRESS
import AllDay from 0xALLDAYADDRESS

pub fun main(address: Address, id: UInt64): UInt64? {
let account = getAccount(address)

let collectionRef = account.getCapability(AllDay.CollectionPublicPath)
.borrow<&{AllDay.MomentNFTCollectionPublic}>()
?? panic("Could not borrow capability from public collection")

let nft = collectionRef.borrowMomentNFT(id: id)
?? panic("Couldn't borrow momentNFT")

return nft.editionID
}

mediaType

mediaType can be selected from the following list:

Resize Params

The media gateway also supports resizing images by adding query params. You may add as many or as few as you like to suit your needs.

`?format=${format}&quality=${quality}&width=${width}&height=${height}`

The videos cannot be resized.

format

the format of the image can be changed to suit your needs as seen in the cloudflare documentation. We recommend using webp

https://developers.cloudflare.com/images/image-resizing/resize-with-workers/#format

https://media.nflallday.com/editions/353/media/image?format=webp

quality

specifies the quality of the image, for a high quality images we recommend 90, for a lower quality image you can go with 50

https://developers.cloudflare.com/images/image-resizing/resize-with-workers/#quality

https://media.nflallday.com/editions/353/media/image?quality=90

width

the maximum width of the image

https://developers.cloudflare.com/images/image-resizing/resize-with-workers/#width

https://media.nflallday.com/editions/353/media/image?width=500

height

the maximum height of the image

https://developers.cloudflare.com/images/image-resizing/resize-with-workers/#height

https://media.nflallday.com/editions/353/media/image?height=500